package cn.k7g.alloytest;

import cn.k7g.alloy.annotation.AlloyContent;
import cn.k7g.alloy.annotation.Label;
import cn.k7g.alloytest.alloycontenthandler.HelloAlloyContentHandler;
import cn.k7g.alloytest.alloycontenthandler.WorldAlloyContentHandler;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Data
public class UserVo {
    @Label("姓名")
    @NotEmpty
    private String name;

    @Valid
    @Label("工作")
    private Job[] job;

    @Valid
    private int[] job2;

    @AlloyContent(HelloAlloyContentHandler.BEAN_NAME)
    public Long id1 = 1L;
    @AlloyContent(WorldAlloyContentHandler.BEAN_NAME)
    public Long id2 = 1L;

    @Data
    public static class Job {

        private Long id;

        @Label("名称")
        @NotNull
        @Email
        private String name;

        @Email
        private String email;

        @Size(min = 6, max = 20)
        private String password;

    }
}
